<div>

    <h2 translate="tvshowsApp.show.home.title">Show</h2>

    <button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#saveShowModal" ng-click="clear()">
        <span class="glyphicon glyphicon-flash"></span> <span translate="tvshowsApp.show.home.createLabel">Create a new Show</span>
    </button>
    <div class="modal fade" id="saveShowModal" tabindex="-1" role="dialog" aria-labelledby="myShowLabel"
         aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <form name="editForm" role="form" novalidate
                      class="ng-scope ng-invalid ng-invalid-required ng-dirty ng-valid-minlength"
                      ng-submit="create()">

                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"
                                ng-click="clear()">&times;</button>
                        <h4 class="modal-title" id="myShowLabel" translate="tvshowsApp.show.home.createOrEditLabel">
                            Create or edit a Show</h4>
                    </div>
                    <div class="modal-body">
                        <div class="form-group">
                            <label>ID</label>
                            <input type="text" class="form-control" name="id"
                                   ng-model="show.id" readonly>
                        </div>

                        <div class="form-group">
                            <label translate="tvshowsApp.show.name">Name</label>
                            <input type="text" class="form-control" name="name"
                                   ng-model="show.name">
                        </div>
                        <div class="form-group">
                            <label translate="tvshowsApp.show.seasonNumber">SeasonNumber</label>
                            <input type="number" class="form-control" name="seasonNumber"
                                   ng-model="show.seasonNumber">
                        </div>
                        <div class="form-group">
                            <label translate="tvshowsApp.show.lastEpisodeNumber">LastEpisodeNumber</label>
                            <input type="number" class="form-control" name="lastEpisodeNumber"
                                   ng-model="show.lastEpisodeNumber">
                        </div>


                        <div class="form-group">
                            <label translate="tvshowsApp.show.schedule">Schedule</label>

                            <select ng-model="show.schedule" ng-required="isScheduleValid()">
                                <option ng-show="!show.schedule" ng-value="null">Select a day</option>
                                <option ng-repeat="day in days">{{day.name}}</option>
                            </select>
                        </div>

                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="clear()">
                            <span class="glyphicon glyphicon-ban-circle"></span>&nbsp;<span
                            translate="entity.action.cancel">Cancel</span>
                        </button>
                        <button type="submit" ng-disabled="editForm.$invalid" class="btn btn-primary">
                            <span class="glyphicon glyphicon-save"></span>&nbsp;<span translate="entity.action.save">Save</span>
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <div class="modal fade" id="deleteShowConfirmation">
        <div class="modal-dialog">
            <div class="modal-content">
                <form name="deleteForm" ng-submit="confirmDelete(show.id)">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"
                                ng-click="clear()">&times;</button>
                        <h4 class="modal-title" translate="entity.delete.title">Confirm delete operation</h4>
                    </div>
                    <div class="modal-body">
                        <p translate="tvshowsApp.show.delete.question" translate-values="{id: '{{show.id}}'}">Are you
                            sure you want to delete this Show?</p>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="clear()">
                            <span class="glyphicon glyphicon-ban-circle"></span>&nbsp;<span
                            translate="entity.action.cancel">Cancel</span>
                        </button>
                        <button type="submit" ng-disabled="deleteForm.$invalid" class="btn btn-danger">
                            <span class="glyphicon glyphicon-remove-circle"></span>&nbsp;<span
                            translate="entity.action.delete">Delete</span>
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <div class="table-responsive">
        <table class="table table-striped">
            <thead>
            <tr>
                <th translate="tvshowsApp.show.name">Name</th>
                <th translate="tvshowsApp.show.seasonNumber">SeasonNumber</th>
                <th translate="tvshowsApp.show.lastEpisodeNumber">LastEpisodeNumber</th>
                <th translate="tvshowsApp.show.schedule">Schedule</th>
                <th></th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="show in shows">
                <td>{{show.name}}</td>
                <td>{{show.seasonNumber}}</td>
                <td>{{show.lastEpisodeNumber}}</td>
                <td>{{show.schedule}}</td>
                <td>
                    <button type="submit"
                            ui-sref="showHistory({id:show.id})"
                            class="btn btn-info">
                        <span class="glyphicon glyphicon-eye-open"></span>&nbsp;<span
                        translate="tvshowsApp.show.action.viewHistory"> View History</span>
                    </button>
                </td>
                <td>
                    <button type="submit"
                            ui-sref="showDetail({id:show.id})"
                            class="btn btn-info">
                        <span class="glyphicon glyphicon-eye-open"></span>&nbsp;<span translate="entity.action.view"> View</span>
                    </button>
                    <button type="submit"
                            ng-click="update(show.id)"
                            class="btn btn-primary">
                        <span class="glyphicon glyphicon-pencil"></span>&nbsp;<span
                        translate="entity.action.edit"> Edit</span>
                    </button>
                    <button type="submit"
                            ng-click="delete(show.id)"
                            class="btn btn-danger">
                        <span class="glyphicon glyphicon-remove-circle"></span>&nbsp;<span
                        translate="entity.action.delete"> Delete</span>
                    </button>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
